package com.authstr.auth.service.inter;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.authstr.basic.reqres.request.RequestPara;
import com.authstr.model.base.BaseRole;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

public interface RoleService extends IService<BaseRole> {

    Page query(@Param("page") Page page, String name);

    List<Map> getAll(RequestPara para);

    @Transactional(rollbackFor=Exception.class)
    void addOrEdit(BaseRole model, RequestPara para);


    @Transactional(rollbackFor=Exception.class)
    void delete(Long[] ids);

    @Transactional(rollbackFor=Exception.class)
    void deleteChildren(Long[] ids);

    Boolean saveMenuInfo(Long roleId, Long[] menuIds);

    List<Long> getRoleIdByUserId(String userId);
}
